package in.sv.yaazhi.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

@Table(name = "RAGA")
@Entity
@NamedQueries(value=@NamedQuery(name="searchRaga",query="select r from Raga r where r.ragaName =: ragaName"))
public class Raga implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Column(name = "RAGA_ID")
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private long ragaId;
	@Column(name = "RAGA_NAME")
	private String ragaName;
	@Column(name = "AAROHANAM")
	private String aarohanam;
	@Column(name = "AVAROHANAM")
	private String avarohanam;

	public long getRagaId() {
		return ragaId;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((aarohanam == null) ? 0 : aarohanam.hashCode());
		result = prime * result
				+ ((avarohanam == null) ? 0 : avarohanam.hashCode());
		result = prime * result + (int) (ragaId ^ (ragaId >>> 32));
		result = prime * result
				+ ((ragaName == null) ? 0 : ragaName.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Raga other = (Raga) obj;
		if (aarohanam == null) {
			if (other.aarohanam != null)
				return false;
		} else if (!aarohanam.equals(other.aarohanam))
			return false;
		if (avarohanam == null) {
			if (other.avarohanam != null)
				return false;
		} else if (!avarohanam.equals(other.avarohanam))
			return false;
		if (ragaId != other.ragaId)
			return false;
		if (ragaName == null) {
			if (other.ragaName != null)
				return false;
		} else if (!ragaName.equals(other.ragaName))
			return false;
		return true;
	}

	public Raga() {
		super();
	}

	public Raga(long ragaId, String ragaName, String aarohanam,
			String avarohanam) {
		super();
		this.ragaId = ragaId;
		this.ragaName = ragaName;
		this.aarohanam = aarohanam;
		this.avarohanam = avarohanam;
	}

	public void setRagaId(long ragaId) {
		this.ragaId = ragaId;
	}

	public String getRagaName() {
		return ragaName;
	}

	public void setRagaName(String ragaName) {
		this.ragaName = ragaName;
	}

	public String getAarohanam() {
		return aarohanam;
	}

	public void setAarohanam(String aarohanam) {
		this.aarohanam = aarohanam;
	}

	public String getAvarohanam() {
		return avarohanam;
	}

	public void setAvarohanam(String avarohanam) {
		this.avarohanam = avarohanam;
	}

}
